﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <SolidColorBrush x:Key="MetroCheckboxCheck" Color="#FF333333"  />
    <SolidColorBrush x:Key="MetroCheckboxBorder" Color="#FF999999"  />
    <SolidColorBrush x:Key="MetroCheckboxBorderHover" Color="#FF333333"  />
    <SolidColorBrush x:Key="MetroCheckboxTextHover" Color="#FF999999"  />

    <Style TargetType="{x:Type CheckBox}">
        <!--<Setter Property="OverridesDefaultStyle" Value="True"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <BulletDecorator Background="Transparent" x:Name="Bullet">
                        <BulletDecorator.Bullet>
                            <Grid Width="12" Height="12">
                                <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{StaticResource MetroCheckboxBorder}" BorderThickness="{TemplateBinding BorderThickness}"/>
                                <Path x:Name="CheckMark" Stroke="Black" StrokeThickness="1" SnapsToDevicePixels="False" Data="M 0 0 L 6 6 M 0 6 L 6 0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource MetroCheckboxBorderHover}" />
                            <Setter Property="Foreground" Value="{StaticResource MetroCheckboxTextHover}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource MetroCheckboxBorder}" />
                        </Trigger>
                        <Trigger Property="HasContent" Value="true">
                            <Setter Property="Padding" Value="4,0,0,0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="CheckMark"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>